package com.hjy.elasticsearch;

import com.hjy.elasticsearch.canal.OtsCanalClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

@SpringBootApplication
public class ElasticsearchApplication implements CommandLineRunner {
	@Resource
	private OtsCanalClient otsCanalClient;


	public static void main(String[] args) {
		SpringApplication.run(ElasticsearchApplication.class, args);
	}


	@Override
	public void run(String... strings) throws Exception {
		//项目启动，执行canal客户端监听
		otsCanalClient.run();
	}

}
